/*

 ARCHIVO: "globals.h"

 Declaraciones y defines globales.

 Primera versión: 1-4-2012

*/


#ifndef _GLOBALS_H_INCLUDED_
#define _GLOBALS_H_INCLUDED_

// Desactivo las excepciones.
#define _HAS_EXCEPTIONS 0

#ifdef _MSC_VER
// Necesaria para VC++.
#define _STATIC_CPPLIB
#endif


/* CmdLine messages - Begin  */

#define LONG_HELP_OPTION			"help"
#define SHORT_HELP_OPTION			"h"
#define HELP_HELP_OPTION			"displays this help and exit."


#define LONG_VERSION_OPTION			"version"
#define SHORT_VERSION_OPTION		"v"
#define HELP_VERSION_OPTION			"displays the program version and exit."


#define INVALID_NON_OPTION_ARGUMENT "Invalid non-option argument: "
#define REPEATED_OPTION             "Repeated option: "
#define OPTION_REQUIRES             "Option requires "
#define ARGUMENTS                   "argument(s)."
#define UNKNOWN_OPTION              "Unknown option: "
#define MISSING_PARAMETER           "Missing parameter: "

#define DOT							'.'
#define SPACE						' '


#define USAGE						"Usage: "
#define OPTION_ELIPSIS				" [OPTION]..."

#define DEFAULT_OPT_DESCRIPTION     ". With no OPTION, same as "
#define DESC_OPT_PREFIX             ", --"
#define TABS                        "\t\t"

#define VERSION_TEXT				" version: "

/* CmdLine messages - End  */


/* Main messages - Begin  */

#define ERROR_CANNOT_OPEN			"Cannot open "
#define ERROR_UNKNOWN_FUNCTION		"Unknown function "
#define ERROR_INVALID_FUNCTION		"Invalid function "
#define ERROR_BAD_STREAM		    "Error, image format not recognized."
#define ERROR_BAD_IMAGE_FORMAT		"Error reading image, bad format."
#define ERROR_WRITING_OUTPUT	    "Error writing image."
#define ERROR_TRANSFORMING_IMAGE    "Error transforming image."
#define ERROR_PROCESSING_OPTION     "Error processing commands."


#define ERROR_NUMBER_SUCCESS                0
#define ERROR_NUMBER_COMMAND_PARSING        1
#define ERROR_NUMBER_CANNOT_OPEN			2
#define ERROR_NUMBER_UNKNOWN_FUNCTION		3
#define ERROR_NUMBER_INVALID_FUNCTION		4
#define ERROR_NUMBER_BAD_STREAM		        5
#define ERROR_NUMBER_BAD_IMAGE_FORMAT       100
#define ERROR_NUMBER_TRANSFORMING_IMAGE     101
#define ERROR_NUMBER_WRITING_OUTPUT         102


#define HELP_TEXT_ISTREAM           "input file."
#define HELP_TEXT_OSTREAM           "output file."
#define HELP_TEXT_FUNCTION          "function to apply (from 1 to 12)."

#define READING                     "Reading "
#define PROCESSING                  "Processing..."
#define WRITING                     "Writing "
#define COMPLETE                    "Done."


/* Main messages - End  */

// Esta definición asegura que
// un byte puede, al menos, guardar
// valores hasta 255.
typedef unsigned char byte;


#endif
